//
//  MyBusinessViewController.m
//  DaMaoMall
//
//  Created by HXHL-wally on 16/7/25.
//  Copyright © 2016年 daMao-wally. All rights reserved.
//

#import "MyBusinessViewController.h"
#import "MyBusinessTableView.h"
@interface MyBusinessViewController ()

@end

@implementation MyBusinessViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setUpMenu];
    self.titleLabel.text = @"我的商圈";
}

- (void)setUpMenu {
    //设置数据源
    self.menuArray = [NSMutableArray arrayWithArray:@[@"文件夹1",@"文件夹2",@"文件夹3",@"文件夹4",@"文件夹5",@"文件夹6",@"文件夹7",@"文件夹8",@"文件夹9",@"文件夹10"]];
    self.tableArray = [NSMutableArray arrayWithCapacity:self.menuArray.count];
    for (NSString *title in self.menuArray) {
        MyBusinessTableView *table = [[MyBusinessTableView alloc]initWithFrame:CGRectZero style:UITableViewStylePlain];
        table.title = title;
        [self.tableArray addObject:table];
    }
    
    //设置控件位置
    self.menuframe = CGRectMake(0, UI_STATUS_BAR_HEIGHT + UI_NAVIGATION_BAR_HEIGHT, kScreenWidth, 40);
    self.tableframe = CGRectMake(0, CGRectGetMaxY(self.menuframe), kScreenWidth, kScreenHeight - CGRectGetMaxY(self.menuframe));
    
    //调用父类方法加载控件
    [super viewDidLoad]; //最后执行
}
- (void)menuBtnClickAtIndex:(NSInteger)index{
    DMLog(@"%ld",index);
    [self.containerTable scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0] atScrollPosition:UITableViewScrollPositionNone animated:NO];
}

@end
